package currency;

class SynchronizedTest extends Accumulator {
    {
        mId = "synchronized";
    }

    @Override
    public synchronized void accumulate() {
        mValue += sPreLoaded[mIndex++];
        if (mIndex >= SIZE) {
            mIndex = 0;
        }
    }

    @Override
    public synchronized long read() {
        return mValue;
    }
}
